var log4js = require('log4js');
// var path = require('path');
log4js.configure('log4js_configuration.json');
// var logger = log4js.getLogger(path.basename(__filename));
// logger.setLevel('DEBUG');

Object.defineProperty(global, '__stack', {
  get: function(){
    var orig = Error.prepareStackTrace;
    Error.prepareStackTrace = function(_, stack){ return stack; };
    var err = new Error;
    Error.captureStackTrace(err, arguments.callee);
    var stack = err.stack;
    Error.prepareStackTrace = orig;
    return stack;
  }
});

Object.defineProperty(global, '__line', {
  get: function(){
    return __stack[1].getLineNumber();
  }
});

module.exports = log4js;